package gobeshona.restlet;

import org.restlet.routing.Redirector;

import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class RestletTestsResource {

	/*
	 * 
	 * 
	 * 			UserService userService = UserServiceFactory.getUserService();
	        User user = userService.getCurrentUser();

			if (user != null){
				//String target = "/account";  
				log.info("user.getEmail()   " + user.getEmail());
				String target = userService.createLogoutURL("/resources/emails");
				log.info("target: " + target);
				Redirector redirector = new Redirector(getContext(), target, Redirector.MODE_CLIENT_TEMPORARY);  
				  router.attach("/account",redirector);
				// Attach the redirector to the router  
				//TemplateRoute tr = router.attach("/search", redirector);
				log.info("User is not NULL");
			}else{
				String target = userService.createLoginURL("/resources/emails");
				log.info("target else: " + target);
				Redirector redirector = new Redirector(getContext(), target, Redirector.MODE_CLIENT_TEMPORARY);
				
				  router.attach("/account",redirector);
				
				log.info("user is null");
			}

	 */
}
